package com.crb.smartcard.utils;

public class ApduUtil {

    public static String getSelectAid(String aid) {
        String selectApdu = aid;
        if (!aid.toUpperCase().startsWith("00A4")) {
            String hexLc = Integer.toHexString(aid.length() / 2);
            System.out.println("hexLc:" + hexLc);
            String lc = String.format("%2s", hexLc).replace(" ", "0");
            selectApdu = "00A40400" + lc + aid;
        }
        return selectApdu;
    }


}
